package com.inibb.app.dao.sqlt;

import java.util.List;

import org.apache.commons.lang.StringUtils;

public class SqltUtil {

	public boolean isNull(Object o){
		return o==null;
	}

	public boolean isBlank(String str){
		return StringUtils.isBlank(str);
	}


	/**
	 * check whether the search criteria indicates to perform a fuzzy query. 
	 * @param searchCriteria
	 * @return
	 */
	public boolean isFuzzyQuery(String searchCriteria){

		if(StringUtils.isEmpty(searchCriteria)) return false;
		if(searchCriteria.indexOf("%")!=-1) return true;

		return false;
	}
	
	public boolean isEmptyList (List<Object> list) {
		return null == list || list.size() == 0;
	}
	public boolean equals (String s1,String s2) {
		return s1.equals(s2);
		
	}
	
	public String toString (String str) {
		if (null == str) return "null";
		
		return "'"+str+"'";
	}

}
